<?php
 
class DB_Connect {
 
    // constructor
    function __construct() {
 
    }
 
    // destructor
    function __destruct() {
        // $this->close();
    }
 
    // Connecting to database
    public function connect() {

        include_once './config.php';

        // connecting to mysql
	$DB_HOST=DB_HOST;
	$DB_USER=DB_USER;
	$DB_PASSWORD=DB_PASSWORD;
	$DB_DATABASE=DB_DATABASE;

        $con = mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD);

        // selecting database
        mysql_select_db($DB_DATABASE);
 
        // return database handler
        return $con;
    }
 
    // Closing database connection
    public function close() {
        mysql_close();
    }
 
} 
?>

